package StudyCode.summary.mycollection;

import java.util.Iterator;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class NewUnmodifiableIterator {
	public static Iterator unmodifiableIterator(final Iterator ii) {
		return new Iterator() {
			public boolean hasNext() {
				return ii.hasNext();
			}

			public Object next() {
				return ii.next();
			}

			public void remove() {
				throw new UnsupportedOperationException("不支持的方法.");
			}
		};
	}
}
